/*
package com.gongyibao.gbase.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.stream.Collectors;

*/
/**
 * @Auther: hm
 * @Date: 2018/12/11 16:23
 * @Description:
 *//*

@Configuration
public class RedissonConfig {
    @Value("${redis.sentinel.nodes:127.0.0.1:26379}")
    public String host;

    @Value("${redis.password}")
    private String password;
    @Value("${redis.sentinel.master}")
    private String masterName;


    @Bean
    public RedissonClient getRedisson() {
        String[] hosts = host.split(",");
        Arrays.stream(hosts).map(s -> "redis://" + s).collect(Collectors.toList()).toArray(hosts);

        Config config = new Config();
        config.useSentinelServers()
                .setMasterName(masterName)
                .addSentinelAddress(hosts)
                .setCheckSentinelsList(false)
                .setPassword(password)
                .setSentinelPassword(password);


        RedissonClient redisson = Redisson.create(config);
        return redisson;
    }
}
*/
